package com.yong.mestock.ctrl;

import com.yong.mestock.service.StockCodeListSvc;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class CommonCtrl {

    @Autowired
    private StockCodeListSvc stockCodeListSvc;

    @GetMapping("/getCommonTableData")
    public Object getCommonTableData(@Param("tableName")String tableName) {
//        String tableName = "STOCKCODELIST";
        System.out.println("代碼："+tableName);
        Object table = stockCodeListSvc.findTable(tableName);
        return table;
    }

    @GetMapping("/findAllTableName")
    public Object findAllTableName(){
        return stockCodeListSvc.findAllTableName();
    }
}
